﻿using System.Security.Cryptography;
using System.Text;

namespace Student.Common
{
    public class SecurityHelper
    {
        /// <summary>
        /// SHA-512加密
        /// </summary>
        /// <param name="encryptString"></param>
        /// <returns></returns>
        public static string Sha512Encrypt(string encryptString)
        {
            var sha512 = SHA512.Create();
            var utf8Encode = new UTF8Encoding();
            byte[] hashData = sha512.ComputeHash(utf8Encode.GetBytes(encryptString));
            sha512.Clear();
            return Convert.ToBase64String(hashData);
        }
    }
}
